package com.chj.comp.common.rabbitmq.constant;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;

@Getter
@AllArgsConstructor
public enum MsgTypeEnum {

    TYPE_1("1", "简单队列"),
    TYPE_2("2", "工作队列"),
    TYPE_3("3", "广播类型"),
    TYPE_4("4", "路由类型"),
    TYPE_5("5", "主题类型");

    private final String type;
    private final String desc;


    public static MsgTypeEnum getMsgType(String type) {
        return Arrays.asList(values()).stream()
                .filter((o) -> {
                    return o.getType().equals(type);
                })
                .findFirst()
                .orElse(null);
    }
}
